/**
 * 功能描述
 */

define(function (require, exports, module) {
	var aw = require("ajaxwrapper")
	var store =require("store");
	var activeUser = store.get("user");
	
    module.exports = {
    	setData:function(widget){
    		var subnav=widget.get("subnav");
    		var end =moment().isSame(subnav.getValue("date"),"day")?moment().valueOf():moment(subnav.getValue("date")).endOf("day").valueOf();
    		aw.ajax({
    			url:"api/travel/dailybusiness",
    			data:{
    				pkServicePoint:subnav.getValue("servicePoint"),
    				start:subnav.getValue("date"),
    				end:end
    			},
				success: function(data){
					widget.get("model").data = data;
					widget.renderPartial(".J-table");
				}
    		})
    	},
    };
});
